<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <script>
    // 利用构造函数来继承父类的属性
    let Father = function (uanme, age) {
      this.uanme = uanme;
      this.age = age;
    };
    let Son = function (uanme, age, score) {
      Father.call(this, uanme, age); //使用call()调用父构造函数,并传递this(当前子类)
      this.score = score;
    };
    let son = new Son("刘德华", 19, 100);
    console.log(son);
  </script>
</body>

</html>